home *** CD-ROM | disk | FTP | other *** search
- #if !defined(FWTRACE_H) && defined(FW_DEBUG)
- #define FWTRACE_H
- // This entire file is for debugging only
- //========================================================================================
- //
- // File: FWTrace.h
- // Release Version: $ 1.0d1 $
- //
- // Creation Date: 3/28/94
- //
- // Copyright: © 1994 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWDBGSTR_H
- #include "FWDbgStr.h"
- #endif
-
- #ifndef FWTRACET_H
- #include "FWTraceT.h"
- #endif
-
- //========================================================================================
- // CLASS FW_CTraceRuntime
- //========================================================================================
-
- class FW_CTraceRuntime
- {
- public:
-
- static short Initialize(FW_CDebugStream *traceStream);
- // Prepare to trace. Acquires resources needed for tracing.
- // Client must ensure that traceStream is opened for writing.
- // Returns zero if could not initialize, non-zero if successful.
-
- static void Terminate();
- // Release resources needed for tracing.
- // Client can now close the trace stream.
-
- static void StartTrace();
- // Starts (resumes) tracing to the trace stream.
- // It is an error to start tracing without successful call to Initialize.
-
- static void StopTrace();
- // Stops (suspends) tracing to the trace stream.
-
- static void IncrTraceDepth();
- static void DecrTraceDepth();
-
- #ifdef FW_BUILD_WIN
- static void* GetTraceBuffer();
- static void SetTraceBuffer(void* pTraceBuffer);
- static void TraceIn();
- static void TraceOut();
-
- static void DumpOneLine(FW_CDebugStream& traceStream,
- const char* pzPrefix,
- unsigned hModule, // HANDLE
- unsigned wSegment, // WORD
- unsigned wOffset); // WORD
- #endif
-
- enum StepInOut { kStepIn=0, kStepOut=1};
- static char gPrefixChar[2];
-
- #ifdef FW_BUILD_MAC
- static void TraceIn();
- static void TraceOut();
- static void DumpOneLine(FW_CDebugStream& traceStream,
- unsigned short depth,
- StepInOut direction,
- const char* procName);
- #endif
-
- private:
- FW_CTraceRuntime();
- // Don't construct this object.
- };
-
- #endif
-